package mrusanov.player

object DamageType {
	private val types = List(Blade, Impact, Pierce, Arcane)
	private val names = types.map(t => (t.name, t)).toMap

	def damageTypeByName(name: String): DamageType = {
		require(names.keySet.contains(name), "Map doesn't contain element " + name)
		names(name)
	}

	val resistancesCount = 4
}

sealed abstract class DamageType(val name: String, val messageKey: String) {

}

object Blade extends DamageType("b", "damageType.blade")
object Impact extends DamageType("i", "damageType.impact")
object Pierce extends DamageType("p", "damageType.pierce")
object Arcane extends DamageType("a", "damageType.arcane")
